<template>
  <div class="show-avatar" v-if="custom.is_show_avatar_url">
    <div class="content">
      <div class="data-stats">
        <div class="stats-left stats-item">
          <div class="number">{{ browse.number }}</div>
          <div class="name">{{ browse.name }}</div>
        </div>
        <div class="stats-center stats-item">
          <div class="number">{{ share.number }}</div>
          <div class="name">{{ share.name }}</div>
        </div>
        <div class="stats-right stats-item">
          <div class="number">{{ enroll.number }}</div>
          <div class="name">{{ enroll.name }}</div>
        </div>
      </div>
      <div class="data-list">
        <ul class="list">
          <li class="list-item" v-for="(item,index) in 3">
            <template v-for="(item,index) in 5">
              <div class="list-item-sample">
                <div class="item-avatar">
                  <img :src="sample.avatar" alt=""/>
                </div>
                <div class="nickname">
                  {{sample.nickname}}
                </div>
              </div>
            </template>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "ShowAvatar",
  props: {
    custom: {
      type: Object
    }
  },
  data() {
    return {
      browse: {
        name: '浏览量',
        number: 2498
      },
      share: {
        name: '分享量',
        number: 1498
      },
      enroll: {
        name: '报名量',
        number: '898',
      },
      sample: {
        avatar: 'https://cdn.s.shangjiadao.cn/source/images/avatar_template.png',
          nickname: '微*称'
      }
    }
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>

.show-avatar {
  width: 100%;
  height: 240px;
  padding: 15px;
  margin: 0;
}

.content {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background-color: #FFFFFF;
  position: relative;
}

.data-stats {
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e8e8e8;
  .stats-item {
    width: 30%;
    text-align: center;
  }
  .number {
    font-size: 20px;
    font-weight: bold;
    color: #ff0a00;
  }
  .name {
    font-size: 12px;
  }
}

.data-list {
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  overflow-y: hidden;
  height: 140px;
  .list {
    width: 100%;
    height: auto;
    box-sizing: border-box;
    white-space: nowrap;
    animation: move 4s linear infinite;
    @keyframes move {
      from {
        /* 往上移动50% */
        // transform: translateY(25%);
      }
      to {
        transform: translateY(-70%);
      }
    }
    .list-item {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      box-sizing: border-box;
      .list-item-sample {
        width: 20%;
        text-align: center;
        img {
          height: 40px;
          width: 40px;
          overflow: hidden;
          border-radius: 50%;
        }
        .nickname {
          font-size: 14px;
        }
      }
    }
  }
}
</style>
